package com.ncloud.aaaa.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ncloud.common.exception.UserException;
import com.ncloud.aaaa.model.Subsys;
import com.ncloud.aaaa.repository.SubsysRepository;
import com.ncloud.aaaa.service.SubsysService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Service
public class SubsysServiceImpl implements SubsysService {
	
	private static final Logger logger = LogManager.getLogger(SubsysServiceImpl.class);
	@Autowired
	private SubsysRepository repository;

	@Override
	public List<Subsys> getSubsysListByUserId(Long userId) {
		List<Subsys> syseSubsys = new ArrayList<Subsys>();
		try{
			syseSubsys = repository.getSubsysListByUserId(userId);
		}catch (Exception e) {
			throw new UserException(e.toString());
		}
		
		return syseSubsys;
	}


}
